#include <joyos.h>
#include <happylib.h>

#include "define.h"

int blinkLED(void){
	motor_set_vel(MOTOR_PORT_TOWER, 255);
	int i = 0;
	int count = 0;
	while(get_time() < 60000){
		if(i>=255){
			count = -10;
		}else if(i<=255){
			count = 10;
		}	
		motor_set_vel(MOTOR_PORT_LED, i);
		pause(50);
		motor_set_vel(MOTOR_PORT_LED, i);
		i+=count;		
	}
	return 0;
}

void fantasy(void){
	int (*blinkpt)(void) = blinkLED;
	create_thread(blinkpt,1000, 255, "Blink");
}
